package org.tc.feign.product.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.tc.feign.service.FeignSecondcommoditysService;
import org.tc.product.entity.Secondcommoditys;

import java.util.List;


@RequestMapping("/secondcommoditys")
@CrossOrigin(origins = {"*"}, methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.OPTIONS}, allowCredentials = "true")
@RestController
public class SecondcommoditysController {
    @Autowired
    private FeignSecondcommoditysService feignSecondcommoditysService;

    @RequestMapping("/deleteSecById")
    public int deleteSecById(Integer id, Integer commodityid, Integer stock, Integer storeid) {
        int count = feignSecondcommoditysService.deleteSecById(id, commodityid, stock, storeid);
        return count;
    }

    @RequestMapping("/insertSec")
    public int insertSec(@RequestBody Secondcommoditys secondcommoditys) {
        int count = feignSecondcommoditysService.insertSec(secondcommoditys);
        return count;
    }


    @RequestMapping("/QueryAllSecond")
    public List<Secondcommoditys> QueryAllSecond(Integer storeid) {
        List<Secondcommoditys> list = feignSecondcommoditysService.QueryAllSecond(storeid);
        return list;
    }

    @RequestMapping("/selectAllSec")
    public List<Secondcommoditys> selectAllSec(Integer storeid, Integer state) {
        List<Secondcommoditys> list = feignSecondcommoditysService.selectAll(storeid, state);
        return list;
    }
}
